<?php $itemsPhoto = $this->dataPhoto;  ?>

<div class="mainpage">
<form method="post" enctype="multipart/form-data">
    <div class="top-tools">
    <?php echo $this->flashMessenger()?>
        <div class="pull-right">
            <input type="submit" name="act_delete_gallery" class="btn btn-danger" value="Delete"/>
        </div>
        <div class="clear"></div>
    </div>

    <div class="row-fluid">
        <div class="span3">&nbsp;</div>
        <div class="span5 well form-horizontal">
            <div class="control-group">
                <label class="control-label"> Photo </label>
                <div class="controls">
                    <input type="file" name="thumbnail" />
                </div>
            </div>
            <div class="control-group">
                <label class="control-label"> Caption </label>
                <div class="controls">
                    <textarea name="caption" id="caption"></textarea>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label"> Link to </label>
                <div class="controls">
                    <input type="text" name="link_to" id="link_to"/>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label"> Sorting number </label>
                <div class="controls">
                    <input type="text" name="sorting_number" id="sorting_number"/>
                </div>
            </div>
            <div class="form-action-group">
                <input type="submit" style="width:200px" class="btn btn-primary" name="upload" value="Upload"/>
            </div>
        </div>
    </div>

    <div class="row-fluid">
        <div class="span12">
        	<h3>Photo slide-show</h3>
            <?php if(!$itemsPhoto):?>
                <div class="alert alert-info alert-block">
                <a class="close" data-dismiss="alert">×</a>
                <h4 class="alert-heading">Chưa có ảnh</h4>
                Chưa có ảnh slide-show nào, hãy chọn ảnh để upload.
                </div>
            <?php endif; ?>
            <?php
                $i = 0;
                $len = count($itemsPhoto);

                while($i < $len):?>
                    <ul class="thumbnails">

                    <?php while($i < $len ):?>
                                <li class="span3">
                                    <div class="thumbnail" style="height:210px;">
                                        <input type="checkbox" name="item_checker[]" value="<?php echo $itemsPhoto[$i]['id']?>"/>
                                        <a href="<?php echo $itemsPhoto[$i]['path']; ?>" class="thumbnail">
                                            <img src="<?php echo $itemsPhoto[$i]['path']; ?>"  alt="" style="width: 180px; height: 120px;"/>
                                        </a>
                                        <div class="caption"><?php echo $this->snippet($itemsPhoto[$i]['caption']); ?></div>
                                    </div>
                                </li>
                    <?php
                        $i++;
                        endwhile;?>
                    </ul>
                <?php endwhile;
            ?>
        </div>
    </div>
    <div class="clear"></div>
</form>
</div>